package top.leinx.fxnotes.stage;

/**
 * @Author : xiaolei
 * @DateTime: 2021/3/11 3:43 下午
 */

import javafx.application.Application;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class StageOwnerExample extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        primaryStage.setTitle("主窗口");

        Stage stage = new Stage();
        stage.initModality(Modality.WINDOW_MODAL);
        stage.initOwner(primaryStage); // 设置其所有者为 primaryStage

        primaryStage.show();
        stage.show();
    }
}
